OCPBUGS-79520: Fix kebab actions on Installed Operators list page#16682
OCPBUGS-79520: Fix kebab actions on Installed Operators list page#16682TheRealJon wants to merge 1 commit into
Conversation
subscriptionForCSV had unnecessary guards checking operatorNamespace and csvName were truthy before matching. When operatorNamespaceFor returned undefined and fallback to csv.metadata.namespace produced falsy value, guard prevented matching even when valid subscription existed with same namespace and installedCSV. Removed operatorNamespace && csvName && guards. Kubernetes objects always have name/namespace, so guards unnecessary. Matching now works correctly with or without olm.operatorNamespace annotation. Added comprehensive test coverage for all matching scenarios including edge cases. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
@TheRealJon: This pull request references Jira Issue OCPBUGS-79520, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@TheRealJon: GitHub didn't allow me to request PR reviews from the following users: openshift/team-olm. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TheRealJon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesCSV subscription matching
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@TheRealJon: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Analysis / Root cause:
The Installed Operators list page was showing incorrect kebab menu actions. Instead of displaying "Edit Subscription" and "Uninstall Operator" for installed operators, it only showed "Delete ClusterServiceVersion". This occurred for operators in both "Installing" and "Succeeded" status.
Root cause:
subscriptionForCSV()helper function had unnecessary guards (operatorNamespace &&andcsvName &&) that prevented matching when theolm.operatorNamespaceannotation was missing. WhenoperatorNamespaceFor(csv)returnedundefinedand fell back tocsv.metadata.namespace, the truthy guard still failed, preventing the function from finding the matching subscription even when one existed.Solution description:
Removed the unnecessary
operatorNamespace &&andcsvName &&guards from the matching logic insubscriptionForCSV(). Kubernetes objects always have name and namespace properties, so these guards were not needed. The function now correctly matches subscriptions whether or not theolm.operatorNamespaceannotation is present:Added comprehensive test coverage with 8 test cases covering all matching scenarios including edge cases.
Screenshots / screen recording:
Test setup:
Test cases:
yarn test packages/operator-lifecycle-manager/src/status/__tests__/csv-status.spec.tsBrowser conformance:
Additional info:
Related to CONSOLE-4685 which refactored CSV actions. That PR added the fallback logic but kept the guards, which caused this regression.
Reviewers and assignees:
/assign @spadgett
/cc @openshift/team-olm
Jira: https://redhat.atlassian.net/browse/OCPBUGS-79520
Summary by CodeRabbit
Bug Fixes
Tests